home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xa / undo / PIInstructionUndoable.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  1.7 KB  |  39 lines

  1. package com.extensibility.xa.undo;
  2.  
  3. import com.extensibility.app.UI;
  4. import com.extensibility.xa.PIModel;
  5. import com.extensibility.xa.XADesktop;
  6. import com.extensibility.xml.BaseDeclaration;
  7. import com.extensibility.xml.ProcessingInstruction;
  8.  
  9. public class PIInstructionUndoable extends DeclTableUndoable {
  10.    ProcessingInstruction piDecl;
  11.  
  12.    public PIInstructionUndoable(PIModel var1, BaseDeclaration var2, Object var3) {
  13.       super(XADesktop.getTableForModel(var1), var2, var3);
  14.       this.piDecl = (ProcessingInstruction)var2;
  15.       super.oldValue = ((PIModel)super.tableModel).getValueAt(super.tableModel.getRowForDecl(this.piDecl), 3);
  16.    }
  17.  
  18.    public String getPresentationName() {
  19.       return UI.getString("undo.pi.instruction");
  20.    }
  21.  
  22.    public void undo() {
  23.       super.undo();
  24.       String var1 = super.oldValue == null ? "" : (String)super.oldValue;
  25.       this.piDecl.setInstruction(var1);
  26.       ((DeclTableUndoable)this).setCellFocus(super.tableModel.getRowForDecl(this.piDecl), 3);
  27.    }
  28.  
  29.    public void doCommand() {
  30.       this.piDecl.setInstruction((String)super.newValue);
  31.    }
  32.  
  33.    public void redo() {
  34.       super.redo();
  35.       this.doCommand();
  36.       ((DeclTableUndoable)this).setCellFocus(super.tableModel.getRowForDecl(this.piDecl), 3);
  37.    }
  38. }
  39.